<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="DataSet" targetNamespace="http://tempuri.org/DataSet.xsd" xmlns:mstns="http://tempuri.org/DataSet.xsd" xmlns="http://tempuri.org/DataSet.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
  <xs:annotation>
    <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
      <DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
        <Connections>
          <Connection AppSettingsObjectName="Settings" AppSettingsPropertyName="DIAptekaConnectionString" ConnectionStringObject="" IsAppSettingsProperty="True" Modifier="Assembly" Name="DIAptekaConnectionString (Settings)" ParameterPrefix="@" PropertyReference="ApplicationSettings.Reports.Properties.Settings.GlobalReference.Default.DIAptekaConnectionString" Provider="System.Data.SqlClient">
          </Connection>
        </Connections>
        <Tables>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="DataFromDBTableAdapter" GeneratorDataComponentClassName="DataFromDBTableAdapter" Name="DataFromDB" UserDataComponentName="DataFromDBTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="DIAptekaConnectionString (Settings)" DbObjectName="" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="False" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="False" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="False">
                    <CommandText>SELECT     @DepartName AS DepartName, vwGoodsDetailed.FullName AS GoodsName, CD.Parties.GoodsId AS GoodsCode, CD.Parties.RetailPrice AS Price, 
                      CD.Parties.BarCode AS Barcode, CA.Contragents.ShortName AS Contractor,
                          (SELECT     ISNULL(SUM(Qntty), 0) AS sum
                            FROM          vwGoodsFlow AS vwgi
                            WHERE      (DocDate &lt; @DateF) AND (PartyId = CD.Parties.Id)) AS StartCount,
                          (SELECT     ISNULL(SUM(Qntty), 0) AS sum
                            FROM          vwGoodsFlow AS vwgi
                            WHERE      (DocDate &lt; @DateT) AND (PartyId = CD.Parties.Id)) AS EndCount, CASE WHEN Qntty &gt; 0 THEN Qntty ELSE 0 END AS IncomeCount, 
                      CASE WHEN Qntty &lt; 0 THEN Qntty * - 1 ELSE 0 END AS ExpenceCount, CA.Documents.DocNumber, CO.DocTypes.ShortName AS DocType, 
                      CA.Documents.DocDate, CA.Documents.DocTypeId AS DocTypeCode
FROM         CA.GoodsDocLines INNER JOIN
                      CA.Documents ON CA.GoodsDocLines.DocId = CA.Documents.Id INNER JOIN
                      CD.Parties ON CA.GoodsDocLines.PartyId = CD.Parties.Id INNER JOIN
                      CO.DocTypes ON CA.Documents.DocTypeId = CO.DocTypes.Id INNER JOIN
                      CA.Contragents ON CA.Documents.ContragentId = CA.Contragents.Id INNER JOIN
                      vwGoodsDetailed ON vwGoodsDetailed.Id = CD.Parties.GoodsId
WHERE     (CA.Documents.DocDate BETWEEN @DateF AND @DateT)
ORDER BY DepartName, GoodsName, Barcode</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="False" AutogeneratedName="DepartName" ColumnName="" DataSourceName="" DataTypeServer="unknown" DbType="AnsiString" Direction="Input" ParameterName="@DepartName" Precision="0" Scale="0" Size="1024" SourceColumn="" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                      <Parameter AllowDbNull="False" AutogeneratedName="DateF" ColumnName="DocDate" DataSourceName="DIApteka.CA.Documents" DataTypeServer="smalldatetime" DbType="DateTime" Direction="Input" ParameterName="@DateF" Precision="0" ProviderType="SmallDateTime" Scale="0" Size="4" SourceColumn="DocDate" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                      <Parameter AllowDbNull="False" AutogeneratedName="DateT" ColumnName="DocDate" DataSourceName="DIApteka.CA.Documents" DataTypeServer="smalldatetime" DbType="DateTime" Direction="Input" ParameterName="@DateT" Precision="0" ProviderType="SmallDateTime" Scale="0" Size="4" SourceColumn="DocDate" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="DepartName" DataSetColumn="DepartName" />
              <Mapping SourceColumn="GoodsName" DataSetColumn="GoodsName" />
              <Mapping SourceColumn="GoodsCode" DataSetColumn="GoodsCode" />
              <Mapping SourceColumn="Price" DataSetColumn="Price" />
              <Mapping SourceColumn="Barcode" DataSetColumn="Barcode" />
              <Mapping SourceColumn="Contractor" DataSetColumn="Contractor" />
              <Mapping SourceColumn="StartCount" DataSetColumn="StartCount" />
              <Mapping SourceColumn="EndCount" DataSetColumn="EndCount" />
              <Mapping SourceColumn="IncomeCount" DataSetColumn="IncomeCount" />
              <Mapping SourceColumn="ExpenceCount" DataSetColumn="ExpenceCount" />
              <Mapping SourceColumn="DocNumber" DataSetColumn="DocNumber" />
              <Mapping SourceColumn="DocType" DataSetColumn="DocType" />
              <Mapping SourceColumn="DocDate" DataSetColumn="DocDate" />
              <Mapping SourceColumn="DocTypeCode" DataSetColumn="DocTypeCode" />
            </Mappings>
            <Sources>
            </Sources>
          </TableAdapter>
        </Tables>
        <Sources>
        </Sources>
      </DataSource>
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="DataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:Generator_UserDSName="DataSet" msprop:Generator_DataSetName="DataSet">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="Info" msprop:Generator_UserTableName="Info" msprop:Generator_RowDeletedName="InfoRowDeleted" msprop:Generator_RowChangedName="InfoRowChanged" msprop:Generator_RowClassName="InfoRow" msprop:Generator_RowChangingName="InfoRowChanging" msprop:Generator_RowEvArgName="InfoRowChangeEvent" msprop:Generator_RowEvHandlerName="InfoRowChangeEventHandler" msprop:Generator_TableClassName="InfoDataTable" msprop:Generator_TableVarName="tableInfo" msprop:Generator_RowDeletingName="InfoRowDeleting" msprop:Generator_TablePropName="Info">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="AptekaName" msprop:Generator_UserColumnName="AptekaName" msprop:nullValue="_empty" msprop:Generator_ColumnVarNameInTable="columnAptekaName" msprop:Generator_ColumnPropNameInTable="AptekaNameColumn" msprop:Generator_ColumnPropNameInRow="AptekaName" type="xs:string" minOccurs="0" />
              <xs:element name="DateF" msprop:Generator_UserColumnName="DateF" msprop:Generator_ColumnVarNameInTable="columnDateF" msprop:Generator_ColumnPropNameInRow="DateF" msprop:Generator_ColumnPropNameInTable="DateFColumn" type="xs:dateTime" minOccurs="0" />
              <xs:element name="DateT" msprop:Generator_UserColumnName="DateT" msprop:Generator_ColumnVarNameInTable="columnDateT" msprop:Generator_ColumnPropNameInRow="DateT" msprop:Generator_ColumnPropNameInTable="DateTColumn" type="xs:dateTime" minOccurs="0" />
              <xs:element name="BegSum" msprop:Generator_UserColumnName="BegSum" msprop:Generator_ColumnPropNameInRow="BegSum" msprop:Generator_ColumnVarNameInTable="columnBegSum" msprop:Generator_ColumnPropNameInTable="BegSumColumn" type="xs:decimal" minOccurs="0" />
              <xs:element name="EndSum" msprop:Generator_UserColumnName="EndSum" msprop:Generator_ColumnPropNameInRow="EndSum" msprop:Generator_ColumnVarNameInTable="columnEndSum" msprop:Generator_ColumnPropNameInTable="EndSumColumn" type="xs:decimal" minOccurs="0" />
              <xs:element name="ReturnSupplier" msprop:Generator_UserColumnName="ReturnSupplier" msprop:Generator_ColumnPropNameInRow="ReturnSupplier" msprop:Generator_ColumnVarNameInTable="columnReturnSupplier" msprop:Generator_ColumnPropNameInTable="ReturnSupplierColumn" type="xs:decimal" minOccurs="0" />
              <xs:element name="AllOutput" msprop:Generator_UserColumnName="AllOutput" msprop:Generator_ColumnPropNameInRow="AllOutput" msprop:Generator_ColumnVarNameInTable="columnAllOutput" msprop:Generator_ColumnPropNameInTable="AllOutputColumn" type="xs:decimal" minOccurs="0" />
              <xs:element name="DicSum" msprop:Generator_UserColumnName="DicSum" msprop:Generator_ColumnPropNameInRow="DicSum" msprop:Generator_ColumnVarNameInTable="columnDicSum" msprop:Generator_ColumnPropNameInTable="DicSumColumn" type="xs:decimal" default="0" minOccurs="0" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="Data" msprop:Generator_UserTableName="Data" msprop:Generator_RowDeletedName="DataRowDeleted" msprop:Generator_RowChangedName="DataRowChanged" msprop:Generator_RowClassName="DataRow" msprop:Generator_RowChangingName="DataRowChanging" msprop:Generator_RowEvArgName="DataRowChangeEvent" msprop:Generator_RowEvHandlerName="DataRowChangeEventHandler" msprop:Generator_TableClassName="DataDataTable" msprop:Generator_TableVarName="tableData" msprop:Generator_RowDeletingName="DataRowDeleting" msprop:Generator_TablePropName="Data">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="DepartName" msprop:Generator_UserColumnName="DepartName" msprop:nullValue="_empty" msprop:Generator_ColumnVarNameInTable="columnDepartName" msprop:Generator_ColumnPropNameInTable="DepartNameColumn" msprop:Generator_ColumnPropNameInRow="DepartName" type="xs:string" minOccurs="0" />
              <xs:element name="GoodsName" msprop:Generator_UserColumnName="GoodsName" msprop:nullValue="_empty" msprop:Generator_ColumnVarNameInTable="columnGoodsName" msprop:Generator_ColumnPropNameInTable="GoodsNameColumn" msprop:Generator_ColumnPropNameInRow="GoodsName" type="xs:string" minOccurs="0" />
              <xs:element name="GoodsCode" msprop:Generator_UserColumnName="GoodsCode" msprop:nullValue="_empty" msprop:Generator_ColumnVarNameInTable="columnGoodsCode" msprop:Generator_ColumnPropNameInTable="GoodsCodeColumn" msprop:Generator_ColumnPropNameInRow="GoodsCode" type="xs:string" minOccurs="0" />
              <xs:element name="Price" msprop:Generator_UserColumnName="Price" msprop:Generator_ColumnVarNameInTable="columnPrice" msprop:Generator_ColumnPropNameInRow="Price" msprop:Generator_ColumnPropNameInTable="PriceColumn" type="xs:decimal" minOccurs="0" />
              <xs:element name="Barcode" msprop:Generator_UserColumnName="Barcode" msprop:nullValue="_empty" msprop:Generator_ColumnVarNameInTable="columnBarcode" msprop:Generator_ColumnPropNameInTable="BarcodeColumn" msprop:Generator_ColumnPropNameInRow="Barcode" type="xs:string" minOccurs="0" />
              <xs:element name="Contractor" msprop:Generator_UserColumnName="Contractor" msprop:nullValue="_empty" msprop:Generator_ColumnVarNameInTable="columnContractor" msprop:Generator_ColumnPropNameInTable="ContractorColumn" msprop:Generator_ColumnPropNameInRow="Contractor" type="xs:string" minOccurs="0" />
              <xs:element name="StartCount" msprop:Generator_UserColumnName="StartCount" msprop:Generator_ColumnVarNameInTable="columnStartCount" msprop:Generator_ColumnPropNameInRow="StartCount" msprop:Generator_ColumnPropNameInTable="StartCountColumn" type="xs:int" minOccurs="0" />
              <xs:element name="EndCount" msprop:Generator_UserColumnName="EndCount" msprop:Generator_ColumnVarNameInTable="columnEndCount" msprop:Generator_ColumnPropNameInRow="EndCount" msprop:Generator_ColumnPropNameInTable="EndCountColumn" type="xs:int" minOccurs="0" />
              <xs:element name="IncomeCount" msprop:Generator_UserColumnName="IncomeCount" msprop:Generator_ColumnVarNameInTable="columnIncomeCount" msprop:Generator_ColumnPropNameInRow="IncomeCount" msprop:Generator_ColumnPropNameInTable="IncomeCountColumn" type="xs:int" minOccurs="0" />
              <xs:element name="ExpenceCount" msprop:Generator_UserColumnName="ExpenceCount" msprop:Generator_ColumnVarNameInTable="columnExpenceCount" msprop:Generator_ColumnPropNameInRow="ExpenceCount" msprop:Generator_ColumnPropNameInTable="ExpenceCountColumn" type="xs:int" minOccurs="0" />
              <xs:element name="DocNumber" msprop:Generator_UserColumnName="DocNumber" msprop:nullValue="_empty" msprop:Generator_ColumnPropNameInRow="DocNumber" msprop:Generator_ColumnPropNameInTable="DocNumberColumn" msprop:Generator_ColumnVarNameInTable="columnDocNumber" type="xs:string" minOccurs="0" />
              <xs:element name="DocType" msprop:Generator_UserColumnName="DocType" msprop:nullValue="_empty" msprop:Generator_ColumnVarNameInTable="columnDocType" msprop:Generator_ColumnPropNameInTable="DocTypeColumn" msprop:Generator_ColumnPropNameInRow="DocType" type="xs:string" minOccurs="0" />
              <xs:element name="DocDate" msprop:Generator_UserColumnName="DocDate" msprop:Generator_ColumnVarNameInTable="columnDocDate" msprop:Generator_ColumnPropNameInRow="DocDate" msprop:Generator_ColumnPropNameInTable="DocDateColumn" type="xs:dateTime" minOccurs="0" />
              <xs:element name="DocTypeCode" msprop:Generator_UserColumnName="DocTypeCode" msprop:Generator_ColumnPropNameInRow="DocTypeCode" msprop:Generator_ColumnVarNameInTable="columnDocTypeCode" msprop:Generator_ColumnPropNameInTable="DocTypeCodeColumn" type="xs:int" minOccurs="0" />
              <xs:element name="Price1" msprop:Generator_UserColumnName="Price1" msprop:Generator_ColumnVarNameInTable="columnPrice1" msprop:Generator_ColumnPropNameInRow="Price1" msprop:Generator_ColumnPropNameInTable="Price1Column" type="xs:decimal" minOccurs="0" />
              <xs:element name="Discount" msprop:Generator_UserColumnName="Discount" msprop:Generator_ColumnVarNameInTable="columnDiscount" msprop:Generator_ColumnPropNameInRow="Discount" msprop:Generator_ColumnPropNameInTable="DiscountColumn" type="xs:unsignedByte" minOccurs="0" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="DataFromDB" msprop:Generator_UserTableName="DataFromDB" msprop:Generator_RowDeletedName="DataFromDBRowDeleted" msprop:Generator_RowChangedName="DataFromDBRowChanged" msprop:Generator_RowClassName="DataFromDBRow" msprop:Generator_RowChangingName="DataFromDBRowChanging" msprop:Generator_RowEvArgName="DataFromDBRowChangeEvent" msprop:Generator_RowEvHandlerName="DataFromDBRowChangeEventHandler" msprop:Generator_TableClassName="DataFromDBDataTable" msprop:Generator_TableVarName="tableDataFromDB" msprop:Generator_RowDeletingName="DataFromDBRowDeleting" msprop:Generator_TablePropName="DataFromDB">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="DepartName" msdata:ReadOnly="true" msprop:Generator_UserColumnName="DepartName" msprop:Generator_ColumnVarNameInTable="columnDepartName" msprop:Generator_ColumnPropNameInRow="DepartName" msprop:Generator_ColumnPropNameInTable="DepartNameColumn" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="1024" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="GoodsName" msdata:ReadOnly="true" msprop:Generator_UserColumnName="GoodsName" msprop:Generator_ColumnVarNameInTable="columnGoodsName" msprop:Generator_ColumnPropNameInRow="GoodsName" msprop:Generator_ColumnPropNameInTable="GoodsNameColumn" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="213" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="GoodsCode" msprop:Generator_UserColumnName="GoodsCode" msprop:Generator_ColumnVarNameInTable="columnGoodsCode" msprop:Generator_ColumnPropNameInRow="GoodsCode" msprop:Generator_ColumnPropNameInTable="GoodsCodeColumn" type="xs:int" />
              <xs:element name="Price" msprop:Generator_UserColumnName="Price" msprop:Generator_ColumnVarNameInTable="columnPrice" msprop:Generator_ColumnPropNameInRow="Price" msprop:Generator_ColumnPropNameInTable="PriceColumn" type="xs:decimal" />
              <xs:element name="Barcode" msprop:Generator_UserColumnName="Barcode" msprop:Generator_ColumnVarNameInTable="columnBarcode" msprop:Generator_ColumnPropNameInRow="Barcode" msprop:Generator_ColumnPropNameInTable="BarcodeColumn">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="12" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Contractor" msprop:Generator_UserColumnName="Contractor" msprop:Generator_ColumnVarNameInTable="columnContractor" msprop:Generator_ColumnPropNameInRow="Contractor" msprop:Generator_ColumnPropNameInTable="ContractorColumn">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="StartCount" msdata:ReadOnly="true" msprop:Generator_UserColumnName="StartCount" msprop:Generator_ColumnVarNameInTable="columnStartCount" msprop:Generator_ColumnPropNameInRow="StartCount" msprop:Generator_ColumnPropNameInTable="StartCountColumn" type="xs:int" minOccurs="0" />
              <xs:element name="EndCount" msdata:ReadOnly="true" msprop:Generator_UserColumnName="EndCount" msprop:Generator_ColumnVarNameInTable="columnEndCount" msprop:Generator_ColumnPropNameInRow="EndCount" msprop:Generator_ColumnPropNameInTable="EndCountColumn" type="xs:int" minOccurs="0" />
              <xs:element name="IncomeCount" msdata:ReadOnly="true" msprop:Generator_UserColumnName="IncomeCount" msprop:Generator_ColumnVarNameInTable="columnIncomeCount" msprop:Generator_ColumnPropNameInRow="IncomeCount" msprop:Generator_ColumnPropNameInTable="IncomeCountColumn" type="xs:int" minOccurs="0" />
              <xs:element name="ExpenceCount" msdata:ReadOnly="true" msprop:Generator_UserColumnName="ExpenceCount" msprop:Generator_ColumnVarNameInTable="columnExpenceCount" msprop:Generator_ColumnPropNameInRow="ExpenceCount" msprop:Generator_ColumnPropNameInTable="ExpenceCountColumn" type="xs:int" minOccurs="0" />
              <xs:element name="DocNumber" msprop:Generator_UserColumnName="DocNumber" msprop:Generator_ColumnVarNameInTable="columnDocNumber" msprop:Generator_ColumnPropNameInRow="DocNumber" msprop:Generator_ColumnPropNameInTable="DocNumberColumn">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="DocType" msprop:Generator_UserColumnName="DocType" msprop:Generator_ColumnVarNameInTable="columnDocType" msprop:Generator_ColumnPropNameInRow="DocType" msprop:Generator_ColumnPropNameInTable="DocTypeColumn">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="DocDate" msprop:Generator_UserColumnName="DocDate" msprop:Generator_ColumnVarNameInTable="columnDocDate" msprop:Generator_ColumnPropNameInRow="DocDate" msprop:Generator_ColumnPropNameInTable="DocDateColumn" type="xs:dateTime" />
              <xs:element name="DocTypeCode" msprop:Generator_UserColumnName="DocTypeCode" msprop:Generator_ColumnVarNameInTable="columnDocTypeCode" msprop:Generator_ColumnPropNameInRow="DocTypeCode" msprop:Generator_ColumnPropNameInTable="DocTypeCodeColumn" type="xs:int" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
  </xs:element>
</xs:schema>